<div style="float:left">
	<ul class="nav nav-list bs-docs-sidenav" style="margin:0;width:100px">
		<volist name="group" id="vo">
		<li><a href="javascript:void(0)" id="group_{$vo.group_id}"><i class="icon-chevron-right"></i>{$vo.group_name}</a></li>
		</volist>
	</ul>
</div>
<div style="width:400px;float:right;">
	<table class="table table-condensed table-bordered table-hover holiday-content" style="height:100%">
		<thead><tr><td>联系人</td><td>操作</td></tr></thead>
		<tbody>
			<volist name="list" id="vi">
			<tr><td><a style="height:20px;text-align:left;">{$vi.name}{$vi.mobile}</a></td><td width=50><i class="icon-plus" style="cursor:pointer;opacity:0.6" id="iclass_{$vi.contacter_id}" onclick="addToSendList({$vi.contacter_id},{$vi.mobile})"></i><i class="icon-trash" id="itrash_{$vi.contacter_id}" style="margin-left:8px;cursor:pointer;display:none" onclick="cancelToSendList({$vi.contacter_id},{$vi.mobile})"></i></td></tr>
			</volist>
		</tbody>
	</table>
</div>
<div class="pagination" style="float:right">
	{$page}
</div>

<script>
	function reloadContact(){
	
	}
	function addToSendList($cid,$mobile){
		
		$("#iclass_"+$cid).attr('class',"icon-ok");
		$("#iclass_"+$cid).removeAttr('style');
		$("#itrash_"+$cid).show(233);
		var number = $mobile;
		var allMobile = $(".sendnumber").val();
		var pat = /^(13[0-9]{9})|(15[0-9]{9})|(18[0-9]{9})$/ ;
		if(number == ""){
			$.remind('警告','输入号码为空，请重新输入……');
			return;
		}
		
		if(!pat.test(number)){
			$.remind('警告','输入有不合法的号码:'+number);
			
			return;
		}
		if(allMobile != ''){
			var allMobileArray = allMobile.split(',');
			if($.inArray(number,allMobileArray)){
				$.remind('警告','已加入该号码');
				return;
			}
		}
		$("#sendnumber").val($("#sendnumber").val()+number+",");
		$(".sendnumber").val($(".sendnumber").val()+number+",");
	}
	function cancelToSendList($cid,$mobile){
		
		$("#iclass_"+$cid).attr('class',"icon-plus");
		$("#iclass_"+$cid).css({cursor:'pointer',opacity:'0.6'});
		$("#itrash_"+$cid).hide(233);
		var allMobile = $(".sendnumber").val();
		if(allMobile != ''){
			var allMobileArray = allMobile.split(',');
			var i = $.inArray($mobile,allMobileArray)
 			if(i){
				allMobileArray =allMobileArray.slice(i);
				var mobileString;
				for(var k = 0; k < allMobileArray.lenth;k++){
					mobileString +=  allMobileArray[i]+",";
				}
				
				$("#sendnumber").val(mobileString);
				$(".sendnumber").val(mobileString);
			}else{
				$.remind('警告','不存在该号码');
				return;
			}
		}

	}
	
</script>